<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增仓库表单</title>
</head>
<body>
<script src="js/utils/bootstrap.js"></script>
<script src="js/utils/distpicker.data.js"></script>
<script src="js/utils/distpicker.js"></script>
<script src="js/utils/main.js"></script>
<script>
    $(function () {
        $("#newRepository-save").linkbutton({onClick:function () {
                $("#newRepository-form").form({
                    method:'post',
                    onSubmit:function () {
                        return $(this).form("validate");
                    },
                    success:function (data) {
                        var data = eval("("+data+")");
                        if(data.success){
                            $("#newRepository-form").form("clear");
                            $("#newRepository").dialog("close");
                            $.messager.alert("success","添加成功!","info");
                            $("#rdg").datagrid({
                                url:'allRepositoryPaged',
                                method:'post'
                            });
                            $("#rdg").datagrid("reload");
                        }else{
                            $.messager.alert("failed",data.message,"error");
                        }

                    }
                }).submit();
            }});

        $("#newRepository-close").linkbutton({onClick:function () {
                $("#newRepository").dialog("close");
            }});
    });
    function reset() {
        $("#address").distpicker('reset');
    }
</script>
<div class="form-div">
    <form id="newRepository-form" action="newRepository-form-sub" method="post">
        <div class="div-title-hut"> --------------------------------<span class="span-title">仓库信息</span>---------------------------</div>
        <div class="ddn">
            <input  name="rname" class="easyui-textbox" data-options="label:'仓库名称',required:true,width:400">
        </div>
        <div class="ddn">
            <div id="address" data-toggle="distpicker">
                <select name="province" data-province="北京市"  style="width:30%;height:30px;"></select>
                <select name="city" data-city="北京市市辖区"  style="width:30%;height:30px;"></select>
                <select name="district" data-district="东城区" style="width:30%;height:30px;"></select><br>
                <div style="margin-top:3%;">
                    <a id="reset" onclick="reset()" class="easyui-linkbutton" data-options="width:80,height:25">重置</a>
                </div>
            </div>
        </div>
        <div class="btn ddn">
            <!--此按钮可根据自己业务自行修改或删除-->
            <a id="newRepository-save" class="easyui-linkbutton" data-options="iconCls:'icon-ok2'">新建</a><div style="width: 20px;display: inline-block"></div>
            <a id="newRepository-close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel2'">取消</a>
        </div>
    </form>
</div>
</body>
</html>
